// 导入组件
import Vue from 'vue';
import Router from 'vue-router';

// 首页
const SystemIndex = () => import('@/views/system/SystemIndex.vue') //系统首页
const AccountSettings = () => import('@/views/system/AccountSettings.vue') //账户设置
const SystemInformation = () => import('@/views/system/SystemInformation.vue') //系统信息
const LogIn = () => import('@/views/system/LogIn.vue') //登录日志

// 商品管理
const Goods = () => import('@/views/goods/Goods.vue') //商品列表
const GoodsEdit = () => import('@/views/goods/GoodsEdit.vue') //添加商品
const GoodsInfo = () => import('@/views/goods/GoodsInfo.vue') //添加商品第二步
const GoodsProperty = () => import('@/views/goods/GoodsProperty.vue') //添加商品第san步
const GoodsAudit = () => import('@/views/goods/GoodsAudit.vue') //商品审核

const Category = () => import('@/views/goods/Category.vue')
const Template = () => import('@/views/goods/Template.vue')
const Brand = () => import('@/views/goods/Brand.vue')
const Album = () => import('@/views/goods/Album.vue')

const Spec = () => import('@/views/goods/Spec.vue')
const Para = () => import('@/views/goods/Para.vue')
const AddBrand = () => import('@/views/goods/AddBrand.vue')
const AddCategory = () => import('@/views/goods/AddCategory.vue')
const AddAlbum = () => import('@/views/goods/AddAlbum.vue')

/**
 * 订单管理
 */
const OrderList = () => import('@/views/order/OrderList.vue')
const DetermineOrder = () => import('@/views/order/DetermineOrder.vue')
const OrderMessage = () => import('@/views/order/OrderMessage.vue')
const OrderConfig = () => import('@/views/order/OrderConfig.vue')
const ReturnOrder = () => import('@/views/order/ReturnOrder.vue')
const RefundOrder = () => import('@/views/order/RefundOrder.vue')

const BatchSend = () => import('@/views/order/BatchSend.vue')
const RefundReason = () => import('@/views/order/RefundReason.vue')
const ReturnOrderDetails = () => import('@/views/order/ReturnOrderDetails.vue')
const PrintInvoice = () => import('@/views/order/PrintInvoice.vue')
const LookOrder = () => import('@/views/order/LookOrder.vue')
const UpdateGoodsInformation = () => import('@/views/order/UpdateGoodsInformation.vue')



/**
 * 库存管理
 */
const GoodsDelivery = () => import('@/views/stock/GoodsDelivery.vue')
const GoodsWarehousing = () => import('@/views/stock/GoodsWarehousing.vue')


/**
 * 用户管理
 */
const UserList = () => import('@/views/user/UserList.vue')
const UserLevel = () => import('@/views/user/UserLevel.vue')
const UserByinfo = () => import('@/views/user/UserByinfo.vue')


/**
 * 运营
 */
const AdvertisingAdd = () => import('@/views/advertising/AdvertisingAdd.vue')
const AdvertisingList = () => import('@/views/advertising/AdvertisingList.vue')
const spikeActivity = () => import('@/views/spike/activity.vue')
const fullReductionActivity = () => import('@/views/fullReduction/activity.vue')
const fullAdd = () => import('@/views/fullReduction/add.vue')


/**
 * 统计
 */
const OrderStatistcs = () => import('@/views/statistics/OrderStatistcs.vue') // 交易统计
const FlowStatistcs = () => import('@/views/statistics/FlowStatistcs.vue')   // 流量统计
const CommodityStatistcs = () => import('@/views/statistics/CommodityStatistcs.vue') // 商品统计
const MemberStatistcs = () => import('@/views/statistics/MemberStatistcs.vue') // 会员统计
const SearchStatistcs = () => import('@/views/statistics/SearchStatistcs.vue') // 搜索统计


/**
 * 设置
 */
const PatformInformation = () => import('@/views/setting/PatformInformation.vue') //平台信息
const EssentialInformation = () => import('@/views/setting/EssentialInformation.vue') //基本设置
const MessageAlert = () => import('@/views/setting/MessageAlert.vue') //消息提醒
const VerificationCodeSetting = () => import('@/views/setting/VerificationCodeSetting.vue') //验证码设置


const FreightTemplate = () => import('@/views/setting/FreightTemplate.vue') //运费模板
const LogisticsCompany = () => import('@/views/setting/LogisticsCompany.vue') //物流公司
const PaymentSettings = () => import('@/views/setting/PaymentSettings.vue') //支付设置
const RegionalManagement = () => import('@/views/setting/RegionalManagement.vue') //支付设置

const MemberManagement = () => import('@/views/setting/MemberManagement.vue') //角色管理
const OperationLog = () => import('@/views/setting/OperationLog.vue') //成员管理
const RoleManagement = () => import('@/views/setting/RoleManagement.vue') //操作日志


const Login = () => import('@/views/login.vue') // 登录统计
const Index = () => import('@/views/index.vue') // 主页统计


// 启用路由
Vue.use(Router);

// 导出路由 
export default new Router({
  routes: [{
    path: '/',
    name: '',
    component: Login,
    hidden: true,
    meta: {
      requireAuth: false
    }
  }, { //商品
    path: '/login',
    name: '登录',
    component: Login,
    hidden: true,
    meta: {
      requireAuth: false
    }
  }, {
    path: '/index',
    name: '首页',
    component: Index,
    iconCls: 'el-icon-tickets',
    children: [{ //首页
      path: '/system/system_index',
      name: '系统首页',
      component: SystemIndex,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/system/account_settings',
      name: '账户设置',
      component: AccountSettings,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/system/system_information',
      name: '系统信息',
      component: SystemInformation,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/system/log_in',
      name: '登录日志',
      component: LogIn,
      meta: {
        requireAuth: true
      }
    }, { //商品
      path: '/goods/goods',
      name: '商品列表',
      component: Goods,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/goods/goods_edit',
      name: '添加商品',
      component: GoodsEdit,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/goods/goodsInfo',
      name: '添加商品',
      component: GoodsInfo,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/goods/goodsProperty',
      name: '添加商品',
      component: GoodsProperty,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/goods/goods_audit',
      name: '商品审核',
      component: GoodsAudit,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/goods/category',
      name: '商品分类',
      component: Category,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/goods/template',
      name: '规格参数',
      component: Template,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/goods/album',
      name: '图片库管理',
      component: Album,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/goods/brand',
      name: '品牌管理',
      component: Brand,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/goods/addBrand',
      name: '添加品牌',
      component: AddBrand,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/goods/spec',
      name: '规格管理',
      component: Spec,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/goods/para',
      name: '参数管理',
      component: Para,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/goods/addCategory',
      name: '添加分类',
      component: AddCategory,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/goods/addAlbum',
      name: '添加相册',
      component: AddAlbum,
      meta: {
        requireAuth: true
      }
    }, { //订单
      path: '/order/order',
      name: '订单列表',
      component: OrderList,
      meta: {
        requireAuth: true
      }
    }, { //订单
      path: '/order/batch_send',
      name: '订单列表',
      component: BatchSend,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/order/determine_order',
      name: '确认收货',
      component: DetermineOrder,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/order/update_goods_infomation',
      name: '修改商品信息',
      component: UpdateGoodsInformation,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/order/order_message',
      name: '到货提醒',
      component: OrderMessage,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/order/order_config',
      name: '订单设置',
      component: OrderConfig,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/order/return_order',
      name: '退货申请处理',
      component: ReturnOrder,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/order/return_order_details',
      name: '退货申请处理详情',
      component: ReturnOrderDetails,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/order/refund_order',
      name: '退款申请处理',
      component: RefundOrder,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/order/refund_reason',
      name: '退款原因设置',
      component: RefundReason,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/order/print_invoice',
      name: '退款原因设置',
      component: PrintInvoice,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/order/look_order',
      name: '退款原因设置',
      component: LookOrder,
      meta: {
        requireAuth: true
      }
    }, { //库存
      path: '/stock/goods_warehousing',
      name: '商品入库',
      component: GoodsWarehousing,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/stock/goods_delivery',
      name: '商品出库',
      component: GoodsDelivery,
      meta: {
        requireAuth: true
      }
    }, { //用户
      path: '/user/user_list',
      name: '用户列表',
      component: UserList,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/user/user_level',
      name: '用户等级设置',
      component: UserLevel,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/user/user_by_index',
      name: '用户详情',
      component: UserByinfo,
      meta: {
        requireAuth: true
      }
    },
    { //秒杀
      path: '/spike/activity',
      name: '秒杀活动列表',
      component: spikeActivity,
      meta: {
        requireAuth: true
      }
    },
    { //满减
      path: '/full/activity',
      name: '满减活动列表',
      component: fullReductionActivity,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/full/add',
      name: '添加满减活动',
      component: fullAdd,
      meta: {
        requireAuth: true
      }
    },
    { //活动
      path: '/advertising/advertising_list',
      name: '广告列表',
      component: AdvertisingList,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/advertising/advertising_add',
      name: '添加广告',
      component: AdvertisingAdd,
      meta: {
        requireAuth: true
      }
    }, {  //设置
      path: '/setting/platform_information',
      name: '平台信息',
      component: PatformInformation,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/setting/essential_information',
      name: '基本设置',
      component: EssentialInformation,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/setting/message_alert',
      name: '消息提醒',
      component: MessageAlert,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/setting/verification_code_setting',
      name: '验证码设置',
      component: VerificationCodeSetting,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/setting/freight_template',
      name: '运费模板',
      component: FreightTemplate,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/setting/logistics_company',
      name: '物流公司',
      component: LogisticsCompany,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/setting/role_management',
      name: '角色管理',
      component: RoleManagement,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/setting/member_management',
      name: '成员管理',
      component: MemberManagement,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/setting/operation_log',
      name: '操作日志',
      component: OperationLog,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/setting/payment_settings',
      name: '支付设置',
      component: PaymentSettings,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/setting/regional_management',
      name: '区域管理',
      component: RegionalManagement,
      meta: {
        requireAuth: true
      }
    }, {  //统计
      path: '/statistcs/order_statistcs',
      name: '交易统计',
      component: OrderStatistcs,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/statistcs/flow_statistcs',
      name: '流量统计',
      component: FlowStatistcs,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/statistcs/commodity_statistcs',
      name: '商品统计',
      component: CommodityStatistcs,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/statistcs/member_statistcs',
      name: '会员统计',
      component: MemberStatistcs,
      meta: {
        requireAuth: true
      }
    }, {
      path: '/statistcs/search_statistcs',
      name: '搜索统计',
      component: SearchStatistcs,
      meta: {
        requireAuth: true
      }
    }]
  }]
})

